package org.jeecg.modules.demo.membermanagement.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.membermanagement.entity.MemberInfo;
import org.jeecg.modules.demo.membermanagement.entity.MemberManagement;
import org.jeecg.modules.demo.membermanagement.entity.MyMemberInfo;
import org.jeecg.modules.demo.membermanagement.mapper.MemberManagementMapper;
import org.jeecg.modules.demo.membermanagement.service.IMemberManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Description: 会员管理
 * @Author: jeecg-boot
 * @Date: 2022-01-14
 * @Version: V1.0
 */
@Service
public class MemberManagementServiceImpl extends ServiceImpl<MemberManagementMapper, MemberManagement> implements IMemberManagementService {
    @Autowired
    private MemberManagementMapper memberManagementMapper;

    // 根据id查询会员信息
    @Override
    public MemberInfo getMemberinfoById(String storeId, String memberId) {
        return memberManagementMapper.getMemberinfoById(storeId, memberId);
    }

    // 查询我的客源
    @Override
    public List<MyMemberInfo> getMyMemberList(Integer pageNo, Integer pageSize, String storeId, String stockId) {
        return memberManagementMapper.getMyMemberList(pageNo, pageSize, storeId, stockId);
    }

    //修改会员类别
    @Override
    public void updateMemberType(String memberType, String stockId) {
        memberManagementMapper.updateMemberType(memberType, stockId);
    }

    @Override
    public List<MemberManagement> getNotStockMember(String storeId) {
        return memberManagementMapper.getNotStockMember(storeId);
    }

    @Override
    public void deleteRelationStock(String stockId) {
        memberManagementMapper.deleteRelationStock(stockId);
    }

    @Override
    public void updateMemberTypeByStockId(String stockId) {
        memberManagementMapper.updateMemberTypeByStockId(stockId);
    }

    @Override
    public List<Map<String, Object>> listMemberProject(Map<String, Object> map) {
        return memberManagementMapper.listMemberProject(map);
    }

    @Override
    public MemberManagement getOneRecord(String storeId, String unionId) {
        return memberManagementMapper.getOneRecord(storeId, unionId);
    }

    @Override
    public MemberManagement getOneRecordByUnionId(String storeId, String unionId) {
        return memberManagementMapper.getOneRecordByUnionId(storeId, unionId);
    }

    @Override
    public List<MemberManagement> getRelationsAll(String id, String storeId) {
        return memberManagementMapper.getRelationsAll(id, storeId);
    }

    @Override
    public List<MemberManagement> getRelations(String id, String storeId) {
        return memberManagementMapper.getRelations(id, storeId);
    }

    @Override
    public void updateStockId(String stockId, String id) {
        memberManagementMapper.updateStockId(stockId, id);
    }

    @Override
    public void updateRelationQty(String id, Integer relationQty) {
        memberManagementMapper.updateRelationQty(id, relationQty);
    }

    @Override
    public Integer getRelationsAllQty(String id, String storeId) {
        return memberManagementMapper.getRelationsAllQty(id, storeId);
    }


}
